<template>
  <el-card shadow="never">
    <el-divider content-position="left">个人信息</el-divider>
    <div style="width: 400px;">
      <SubmitForm :form-list="formList" :rule-form="ruleForm" @submit="submit"></SubmitForm>
    </div>
  </el-card>
</template>
<script>
import {mapState} from "vuex";

export default {
  name: "index",
  data() {
    return {
      formList: [
        {
          label: '支付商户号',
          prop: 'id',
          name: 'input',
          colSpan: 24,
          disabled: true
        },
        {
          label: '邮箱',
          prop: 'email',
          name: 'input',
        },
        {
          label: '登录谷歌验证',
          prop: 'google',
          name: 'switch',
          activeText: '开启',
          inactiveText: '关闭',
          activeValue: 1,
          inactiveValue: 0,
          colSpan: 24,
          disabled: true
        },
        {
          label: '谷歌验证码',
          prop: 'googleCode',
          name: 'input',
          colSpan: 24
        }
      ],
      ruleForm: {
        /**
         * 编写测试数据
         */
        username: '',
        email: '',
        google: 1,
        googleCode: ''
      }
    }
  },
  computed: {
    ...mapState("user", ["merchantInfo"]),
  },
  watch: {
    merchantInfo: {
      handler: function (val) {
        console.log(val)
        if (val) {
          this.ruleForm.id = val.id
          this.ruleForm.email = val.email
        }
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    submit() {

    },
  }
}
</script>
<style scoped lang="scss">

</style>
